{% extends 'admin.twig' %}

{% set title %}{{ 'PrivacyManager_GDPR'|translate }}{% endset %}

{% block content %}
    <div piwik-content-intro>
        <h2>{{ 'PrivacyManager_AskingForConsent'|translate }}</h2>
        <p>{{ 'PrivacyManager_ConsentExplanation'|translate }}</p>
    </div>

    <div piwik-content-block content-title="{{ 'PrivacyManager_WhenDoINeedConsent'|translate|e('html_attr') }}" class="privacyAskingForConsent">
        <p>
            {{ 'PrivacyManager_WhenConsentIsNeeded1'|translate }}
            <br /><br />
            {{ 'PrivacyManager_WhenConsentIsNeeded2'|translate('<a href="' ~ linkTo({module: 'PrivacyManager', action: 'privacySettings'}) ~ '">', '</a>.')|raw }}
        </p>
    </div>

    <div piwik-content-block content-title="{{ 'PrivacyManager_HowDoIAskForConsent'|translate|e('html_attr') }}" class="privacyAskingForConsent">
        <p>
            {{ 'PrivacyManager_AskForConsentFollowSteps'|translate }}
        </p>

        <h3>{{ 'PrivacyManager_AskForConsentStep1'|translate }}</h3>
        <p>
            {{ 'PrivacyManager_AskForConsentStep1Desc1'|translate }}
        </p>
        <pre piwik-select-on-focus><code>// require user consent before processing data
_paq.push(['requireConsent']);
_paq.push(['trackPageview']);
[...]</code></pre>
        <p>
            {{ 'PrivacyManager_AskForConsentStep1Desc2'|translate('<a href="https://matomo.org/faq/general/faq_146/" target="_blank" rel="noreferrer noopener">', '</a>')|raw }}
        </p>
        <h3>{{ 'PrivacyManager_AskForConsentStep2'|translate }}</h3>
        <p>
            {{ 'PrivacyManager_AskForConsentStep2Desc'|translate }}
        </p>
        <h3>{{ 'PrivacyManager_AskForConsentStep3'|translate }}</h3>
        <p>
            {{ 'PrivacyManager_AskForConsentStep3Desc'|translate }}
            <br /><br />
            <strong>{{ 'PrivacyManager_AskForConsentStep3DescA'|translate }}</strong>
            <br />
            {{ 'PrivacyManager_AskForConsentStep3DescADesc1'|translate }}
        </p>
        <pre piwik-select-on-focus><code>_paq.push(['rememberConsentGiven'])</code></pre>
        <p>
            {{ 'PrivacyManager_AskForConsentStep3DescADesc2'|translate("<code piwik-select-on-focus>_paq.push(['rememberConsentGiven'])</code>", "<code piwik-select-on-focus>_paq.push(['setConsentGiven'])</code>")|raw }}
            <br /><br />
            {{ 'PrivacyManager_AskForConsentStepNotes'|translate }}
        </p>
            <ol>
            <li>{{ 'PrivacyManager_AskForConsentStep3DescANote1'|translate }}
                <br /><code piwik-select-on-focus>_paq.push(['rememberConsentGiven', optionallyExpireConsentInHours])</code>.</li>
            <li>{{ 'PrivacyManager_AskForConsentStep3DescANote2'|translate }}</li>
            <li>{{ 'PrivacyManager_AskForConsentStep3DescANote3'|translate }}</li>
            </ol>
        <p>
            <br />
            <br />
            <strong>{{ 'PrivacyManager_AskForConsentStep3DescB'|translate }}</strong>
            <br />
            {{ 'PrivacyManager_AskForConsentStep3DescBDesc1'|translate }}
        </p>
        <pre piwik-select-on-focus><code>// require user consent before processing data
_paq.push(['requireConsent']);
_paq.push([‘trackPageview']);
[...]

// user has given consent to process their data
_paq.push(['setConsentGiven']);</code></pre>
        <p>
            {{ 'PrivacyManager_AskForConsentStep3DescBDesc2'|translate("<code piwik-select-on-focus>_paq.push(['requireConsent'])</code>")|raw }}
            <br />
            <br />
            {{ 'PrivacyManager_AskForConsentStepNotes'|translate }}
        </p>
        <ol>
            <li>{{ 'PrivacyManager_AskForConsentStep3DescBNote1'|translate("<code piwik-select-on-focus>_paq.push(['setConsentGiven'])</code>")|raw }}</li>
            <li>{{ 'PrivacyManager_AskForConsentStep3DescBNote2'|translate("<code piwik-select-on-focus>_paq.push(['requireConsent'])</code>")|raw }}</li>
        </ol>

        <h3>{{ 'PrivacyManager_AskForConsentStep4'|translate }}</h3>
        <p>
            {{ 'PrivacyManager_AskForConsentStep4Desc'|translate }}
            <br /><br />
            <strong>{{ 'PrivacyManager_AskForConsentStep4DescA'|translate }}</strong>
            <br />
            {{ 'PrivacyManager_AskForConsentStep4DescADesc'|translate }}
        </p>
        <pre piwik-select-on-focus><code> _paq.push(['forgetConsentGiven']);</code></pre>
        <p>
            {{ 'PrivacyManager_AskForConsentStep4DescADesc2'|translate }}
            <br />
            <br />
            <strong>{{ 'PrivacyManager_AskForConsentStep4DescB'|translate }}</strong><br />
            {{ 'PrivacyManager_AskForConsentStep4DescBDesc'|translate }}
            <br />
        </p>
        <pre piwik-select-on-focus><code>// do not call this once user has removed their consent
_paq.push(['setConsentGiven']);</code></pre>

    </div>
{% endblock %}
